/**
 * 用户工具类
 * */
class UserTool {
  constructor() {
  }

  // 获取角色Code数组
  getRoleCodeArray(roleCodes:string):string[]{
    return roleCodes?.split(",")?.filter(roleCode => !!roleCode) || [];
  }

  // 判断用户是否是超级管理员
  isSuperAdmin(roleCodes: string): boolean {
    return this.getRoleCodeArray(roleCodes).includes("superAdmin");
  }

  // 判断用户是否是客服人员
  isCusSer(roleCodes: string): boolean {
    return this.getRoleCodeArray(roleCodes).includes("cusSer");
  }
}

export const userTool = new UserTool();